

use "nego_s2b.dta",clear

*clean data (drop 2 pairs with inconsistent contracts)
by dydid, sort: egen dydcol = mean(pcol)
gen consisten = .
replace consisten = 1 if dydcol != pcol
drop if consisten == 1

*demographics
tab gender, m
sum age
sum hinc


*no dif on distributive and compatible issue
reg ppri ses if role==0
reg ppri ses if role==1
reg ppri ses
reg pcol ses
reg ppri hinc
reg pcol hinc


*main analysis*
duplicates drop dydid, force

reg intdyd ses
estat esize
estat esize, omega
esize twosample intdyd, by(ses) all
tab ses if e(sample)==1, sum(intdyd) 

reg intdyd dydhinc
estat esize
reg intdyd dydinc
estat esize
